﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class pro_mis_weightSubmit : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            MasApp.BLL.Check.CheckLogin();
        }
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        if (Request.QueryString["weightmissionid"] != null)
        {
            Label lb = new Label();
            lb.Text = Request.QueryString["weightmissionid"].ToString();
            form1.Controls.Add(lb);
            MasApp.Model.weightmission wm = new MasApp.Model.weightmission();
            wm.Weightmissionid = int.Parse(Request.QueryString[0].ToString());
            wm.State = "有效的";
            if (MasApp.BLL.Update.FinishWeightmission(wm) > 0)
            {
                MasApp.BLL.ResponseHelper.alert("提交成功，您可以再“历史任务”列表里查看您的历史任务。", "missub.aspx");
            }
            else
            {
                MasApp.BLL.ResponseHelper.alert("操作失败！", "missub.aspx");
            }
        }
        else
        {
            Label lb = new Label();
            lb.Text = "非法链接";
            form1.Controls.Add(lb);
            MasApp.BLL.ResponseHelper.alert("非法链接", "missub.aspx");
        }
    }
    protected void Button1_Click(object sender, ImageClickEventArgs e)
    {

        if (Request.QueryString["weightmissionid"] != null)
        {
            Label lb = new Label();
            lb.Text = Request.QueryString["weightmissionid"].ToString();
            form1.Controls.Add(lb);
            MasApp.Model.weightmission wm = new MasApp.Model.weightmission();
            wm.Weightmissionid = int.Parse(Request.QueryString[0].ToString());
            wm.State = "有效的";
            if (MasApp.BLL.Update.FinishWeightmission(wm) > 0)
            {
                MasApp.BLL.ResponseHelper.alert("提交成功，您可以再“历史任务”列表里查看您的历史任务。", "missub.aspx");
            }
            else
            {
                MasApp.BLL.ResponseHelper.alert("操作失败！", "missub.aspx");
            }
        }
        else
        {
            Label lb = new Label();
            lb.Text = "非法链接";
            form1.Controls.Add(lb);
            MasApp.BLL.ResponseHelper.alert("非法链接", "missub.aspx");
        }
    }
}
